﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shakes_and_Fidget_Charplaner
{
    public class Conv
    {
        #region conversions
        public static int TI(string value)
        {
            return Convert.ToInt32(value);
        }
        public static DateTime StampToTime(long timestamp)
        {
            DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0);
            date = date.AddSeconds(timestamp);
            return date;
        }
        public static long TimeToStamp(DateTime date)
        {
            TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0));
            long timestamp = (long)t.TotalSeconds;
            return timestamp;
        }
        #endregion

    }
}
